package config

import "fmt"

type Database struct {
	Active     string
	Connection map[string]MySQL
}

type MySQL struct {
	Host        string
	Port        int
	User        string
	Password    string
	Database    string
	TablePrefix string
}

func (s MySQL) Dsn() string {
	str := "%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local"
	return fmt.Sprintf(str, s.User, s.Password, s.Host, s.Port, s.Database)
}
